/*
 * MainFrame.cpp
 *
 *  Created on: 2012-8-28
 *      Author: yangentao@gmail.com
 */
#include "window.h"
#include "FrameWindow.h"


FrameWindow::FrameWindow():exitOnClose(false) {
}

FrameWindow::~FrameWindow() {

}

bool FrameWindow::create(LPCTSTR text, Rect rect, HWND parent){
	WindowParam p;
	p.FrameParam(text, rect);
	p.parent = parent;
	return Super::createFrame(p);
}

MsgResult FrameWindow::onMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	MsgResult r = Super::onMessage(hWnd, uMsg, wParam, lParam);
	if (uMsg == WMX_FINISHED) {
		if (exitOnClose) {
			::PostQuitMessage(0);
		}
	}
	return r;
}

void FrameWindow::setExitOnClose(bool exitOnClose_){
	exitOnClose = exitOnClose_;
}

